
{% extends "PATHomeBundle::base.html.twig" %}

{% block title %}{{ parent() }} - Index{% endblock %}

{% block body %}
    <div class="generic_title">Articles :</div>
         
    <div id="catalog">

        {% for product in product_list %}
        <div class="catalogItem">
            
            {% if product.categoryParent.name == 'Multimédia' %}
            <div class="catalogItem_multimedia">
            {% elseif product.categoryParent.name == 'Jeux & Jouets' %}
            <div class="catalogItem_jouets">
                {% elseif product.categoryParent.name == 'Vêtements' %}
            <div class="catalogItem_vetements">
                {% elseif product.categoryParent.name == 'Pokématos' %}
            <div class="catalogItem_pokematos">
            {% else %}
            <div class="catalogItem_default">
            {% endif %}
  
            <a href="../catalog/{{ product.id }}">
                <div class="catalogItem_img">
                    {% if product.picture.url is defined %}
                        <img src = "{{ asset('bundles/patproduct/images/' ~ product.picture.url) }}" alt = {{ product.picture.title }}/>
                    {% else %}
                        <img src = "{{ asset('bundles/patproduct/images/non_dispo.png') }}" alt="image non disponible"/>
                    {% endif %}
                </div>
                <div class="catalogItem_title">
                    {{ product.name }}
                </div>
            </a>
            </div>
        </div>
        {% endfor %}
    </div>
	
{% endblock %}
